package com.efast.dmom.mgmt.bean.mes;

import java.io.Serializable;
import java.util.Comparator;
import java.util.Date;

public class InfPpPlan implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer generateFormId;
	private Integer lineId;
	private Integer id;
	private String guid;
	private String sto;
	private String planOrderNo;
	private String planType;
	private String factoryCode;
	private String poPartNo;
	private String poPartNoVersion;
	private Integer qty;
	private Date planOfflineDate;
	private String action;
	private String planStatus;
	private Date planOnlineDate;
	private Integer sortNum;
	private String lineName;
	private Date createTime;
	private String createUser;
	private String companyCode;
	private String lastUpdateUser;
	private Date lastUpdateTime;
	private String flagVin;
	
	private Date paintPlanOnlineDate;
	private Date finalPlanOnlineDate;
	
	private String specialRequire;
	public InfPpPlan() {
		super();
	}
	
	public InfPpPlan(String planOrderNo) {
		super();
		this.planOrderNo = planOrderNo;
	}

	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getGuid() {
		return guid;
	}
	public void setGuid(String guid) {
		this.guid = guid;
	}
	public String getSto() {
		return sto;
	}
	public void setSto(String sto) {
		this.sto = sto;
	}
	public String getPlanOrderNo() {
		return planOrderNo;
	}
	public void setPlanOrderNo(String planOrderNo) {
		this.planOrderNo = planOrderNo;
	}
	public String getPlanType() {
		return planType;
	}
	public void setPlanType(String planType) {
		this.planType = planType;
	}
	public String getFactoryCode() {
		return factoryCode;
	}
	public void setFactoryCode(String factoryCode) {
		this.factoryCode = factoryCode;
	}
	public String getPoPartNo() {
		return poPartNo;
	}
	public void setPoPartNo(String poPartNo) {
		this.poPartNo = poPartNo;
	}
	public Integer getQty() {
		return qty;
	}
	public void setQty(Integer qty) {
		this.qty = qty;
	}
	public Date getPlanOfflineDate() {
		return planOfflineDate;
	}
	public void setPlanOfflineDate(Date planOfflineDate) {
		this.planOfflineDate = planOfflineDate;
	}
	public String getAction() {
		return action;
	}
	public void setAction(String action) {
		this.action = action;
	}
	public String getPlanStatus() {
		return planStatus;
	}
	public void setPlanStatus(String planStatus) {
		this.planStatus = planStatus;
	}
	public Date getPlanOnlineDate() {
		return planOnlineDate;
	}
	public void setPlanOnlineDate(Date planOnlineDate) {
		this.planOnlineDate = planOnlineDate;
	}
	public String getPoPartNoVersion() {
		return poPartNoVersion;
	}
	public void setPoPartNoVersion(String poPartNoVersion) {
		this.poPartNoVersion = poPartNoVersion;
	}
	public Integer getSortNum() {
		return sortNum;
	}
	public void setSortNum(Integer sortNum) {
		this.sortNum = sortNum;
	}
	public String getLineName() {
		return lineName;
	}
	public void setLineName(String lineName) {
		this.lineName = lineName;
	}
	
	public Integer getLineId() {
		return lineId;
	}
	public void setLineId(Integer lineId) {
		this.lineId = lineId;
	}
	public Integer getGenerateFormId() {
		return generateFormId;
	}
	public void setGenerateFormId(Integer generateFormId) {
		this.generateFormId = generateFormId;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public String getCompanyCode() {
		return companyCode;
	}
	public void setCompanyCode(String companyCode) {
		this.companyCode = companyCode;
	}
	public String getLastUpdateUser() {
		return lastUpdateUser;
	}
	public void setLastUpdateUser(String lastUpdateUser) {
		this.lastUpdateUser = lastUpdateUser;
	}
	public Date getLastUpdateTime() {
		return lastUpdateTime;
	}
	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}
	public String getFlagVin() {
		return flagVin;
	}
	public void setFlagVin(String flagVin) {
		this.flagVin = flagVin;
	}

	public Date getPaintPlanOnlineDate() {
		return paintPlanOnlineDate;
	}

	public void setPaintPlanOnlineDate(Date paintPlanOnlineDate) {
		this.paintPlanOnlineDate = paintPlanOnlineDate;
	}

	public Date getFinalPlanOnlineDate() {
		return finalPlanOnlineDate;
	}

	public void setFinalPlanOnlineDate(Date finalPlanOnlineDate) {
		this.finalPlanOnlineDate = finalPlanOnlineDate;
	}

	public String getSpecialRequire() {
		return specialRequire;
	}

	public void setSpecialRequire(String specialRequire) {
		this.specialRequire = specialRequire;
	}

	public static Comparator<InfPpPlan> onlineDateComparator = new Comparator<InfPpPlan>() {

		@Override
		public int compare(InfPpPlan plan1, InfPpPlan plan2) {

			if (plan1 == null) {
				return -1;
			}
			if (plan2 == null) {
				return 1;
			}

			if (plan1.getPlanOfflineDate() == null) {
				return -1;
			}
			if (plan2.getPlanOfflineDate() == null) {
				return 1;
			}

			if (plan1.getPlanOfflineDate().equals(plan2.getPlanOfflineDate())) {
				return 0;
			}
			return (plan1.getPlanOfflineDate().before(plan2.getPlanOfflineDate())) ? 1 : -1;
		}
	};
	
	public static Comparator<InfPpPlan> offLineDateComparator = new Comparator<InfPpPlan>() {

		@Override
		public int compare(InfPpPlan plan1, InfPpPlan plan2) {

			if (plan1 == null) {
				return -1;
			}
			if (plan2 == null) {
				return 1;
			}

			if (plan1.getPlanOfflineDate() == null) {
				return -1;
			}
			if (plan2.getPlanOfflineDate() == null) {
				return 1;
			}

			if (plan1.getPlanOfflineDate().equals(plan2.getPlanOfflineDate())) {
				return 0;
			}
			return (plan1.getPlanOfflineDate().before(plan2.getPlanOfflineDate())) ? -1 : 1;
		}
	};

}
